/*
 *  AI7.h
 *  
 *
 *  Created by Rob Hole on 14/06/11.
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>

#define SPACE 's'
#define RED 'r'
#define BLUE 'b'
#define GREEN 'g'

#define DEBUG 1

// Flag vector to signal the end of the wins in the wins array
#define END_OF_WINS 0	

int columns;
int rows;
// NOTE: last_move starts at 1, not 0. This happens to be beneficial because, with padding, the first column is board[1]
int last_move;
int total_time;
int player_1_time;
int last_move_time;

// The Wins Lookup Table
char WINS_LOOKUP[12][4] = {"ggrr","grgr","rgrg","rrgg","grrg","rggr","ggbb","gbgb","bgbg","bbgg","gbbg","bggb"};

FILE *f;

int evalWin(char wins[150][4]);
int readBoard(char board[12][9]);
void findWins(char board[12][9], char wins[150][4], int last_played);
void printBoard(char board[12][9]);
int isWin(char board[12][9], int last_played);



